<%-------------------------------------------------------------------
 * 页面名称：/page/myspace/EsPerPayTransPayDetail.jsp
 * 功能描述：交易详细信息
 * Action: 
 *
 *-------------------------------------------------------------------
--%>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ page import="cn.agiledata.bank.common.util.Constant"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/conf/tld/struts-bean.tld" prefix="bean"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="ipb" uri="/WEB-INF/conf/tld/ipb.tld"%>
<%@ taglib prefix="ad" uri="agiledata"%>
<%
	String path = request.getContextPath();
%>
<script language="javascript">
    <logic:present name="Error">
    var Error = <bean:write name="Error"/>;
    </logic:present>
    <logic:notPresent name="Error">
    var Error = "";
    </logic:notPresent>
    if(Error != ""){
        if(Error == 1){
            alert("对不起，你对此记录没有审核权限！！")
        }
        if(Error == 2){
            alert("对不起，你对此记录没有支付权限！！")
        }
        if(Error == 3){
            alert("对不起，你对此记录没有操作权限！！")
        }
        history.back(-1);
        if(Error == 4){
            alert("对不起，你所填的密码错误，请重新输入！！")
        }
    }
    
    function toPay(){
        if(emptyValidate(getObj("pinkUpPass"),"登录密码") != "") {
            return false;
        }
        document.forms[0].submit();
    }
    
    function auditIt(type){
    	if(getObj('attitude').value.length>30){
				alert("您填写的处理意见过长，请重新填写！");
				getObj('attitude').value="";
				getObj('attitude').focus();
				return;
		}
        if(type == 'Y'){
            if(document.getElementById('attitude').value.length<1){
                document.getElementById('attitude').value = '同意';}
        }else{
            if(document.getElementById('attitude').value.length<1){
                alert("请输入处理意见！");
                return;
            }
        }
        document.getElementById('audit').value=type;
        document.getElementById('transactionID').value='<bean:write name="aqb" property="id"/>';
        var batch = "<bean:write name="aqb" property="batchNo"/>";
        if(batch != "")
            document.forms[0].action='esPerPayTransPayAudit.do?batchNumber='+batch;
        else 
            document.forms[0].action='esPerPayTransPayAudit.do';
    
        document.forms[0].submit();

        
    }
    function cancelTransaction() {
        var transId = document.forms[0].id.value;
        if (confirm('您确定要取消此交易吗？')) {
            location.href='<%=path%>/page/transaction/esPerPayTransPayDel.do?batchType=false&oldStatus=<%=Constant.ES_TRANS_STATUS_UNPAY%>&transactionID='+transId;
        }
    }
</script>
<div id="main">
<div class="content_right">
<div style="width: 745px; margin-left: 10px;">
<div class="titleinfo">交易详细信息</div>
<div class="edit_pass">
<form action="<%=path%>/page/transaction/esPerPayTransPayToPay.do"
	method="post"><input type="hidden" name="ifPay" value="N" /> <input
	type="hidden" name="type" value="1" />
<table width="100%" border="0" align="center" cellpadding="5"
	cellspacing="1" class="blueborder">
	<tr>
		<td colspan="2" align="right">&nbsp;</td>
	</tr>
	<logic:notEmpty name="aqb" property="batchNo">
		<tr>
			<td width="30%" align="right" height="25">批次号：</td>
			<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
				property="batchNo" /></td>
		</tr>
	</logic:notEmpty>
	<tr>
		<td width="30%" align="right" height="25">交易编号：</td>
		<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
			property="transId" /><input name="id" type="hidden"
			value="<bean:write name="aqb" property="id" />"></td>
	</tr>
	<logic:notEmpty name="aqb" property="debit.accountName">
		<tr>
			<td width="30%" align="right" height="25">从：</td>
			<td width="70%" class="fontgraydrop14" height="25"><logic:empty name="aqb"
				property="debit.account.name">
				<logic:empty name="aqb" property="debit.account.email">
					<bean:write name="aqb" property="debit.account.mobile" />
				</logic:empty>
				<logic:notEmpty name="aqb" property="debit.account.email">
					<bean:write name="aqb" property="debit.account.email" />
				</logic:notEmpty>
			</logic:empty> <logic:notEmpty name="aqb" property="debit.account.name">
				<bean:write name="aqb" property="debit.account.name" />
			</logic:notEmpty> 的 <bean:write name="aqb" property="debit.accountName" /></td>
		</tr>
	</logic:notEmpty>
	<logic:notEqual name="aqb" property="actionType.id"
		value="<%=Constant.ACTION_TYPE_D%>">
		<logic:notEqual name="aqb" property="actionType.id"
			value="<%=Constant.ACTION_TYPE_R%>">
			<logic:notEqual name="aqb" property="actionType.id"
				value="<%=Constant.ACTION_TYPE_Y%>">
				<logic:notEmpty name="aqb" property="credit.accountName">
					<tr>
						<td width="30%" align="right" height="25">到：</td>
						<td width="70%" class="fontgraydrop14" height="25"><logic:notEqual
							name="aqb" property="actionType.id"
							value="<%=Constant.ACTION_TYPE_G%>">
							<logic:empty name="aqb" property="credit.account.name">
								<logic:empty name="aqb" property="credit.account.email">
									<bean:write name="aqb" property="credit.account.mobile" />
								</logic:empty>
								<logic:notEmpty name="aqb" property="credit.account.email">
									<bean:write name="aqb" property="credit.account.email" />
								</logic:notEmpty>
							</logic:empty>
							<logic:notEmpty name="aqb" property="credit.account.name">
								<bean:write name="aqb" property="credit.account.name" />
							</logic:notEmpty>
				的
			</logic:notEqual> <!-- 7:付款给对方银行或者叫付款至他人银行账户 --> <logic:equal name="aqb"
							property="actionType.id" value="<%=Constant.ACTION_TYPE_G%>">
							<bean:write name="bankName0" />,<bean:write name="aqb"
								property="bankName" />
						</logic:equal> <logic:notEqual name="aqb" property="actionType.id"
							value="<%=Constant.ACTION_TYPE_G%>">
							<bean:write name="aqb" property="credit.accountName" />
						</logic:notEqual><br />
						<logic:equal name="aqb" property="actionType.id"
							value="<%=Constant.ACTION_TYPE_G%>">
				账号：<bean:write name="aqb" property="cardNo" />
						</logic:equal></td>
					</tr>
				</logic:notEmpty>
			</logic:notEqual>
		</logic:notEqual>
	</logic:notEqual>
	<!-- 4:提现 -->
	<logic:equal name="aqb" property="actionType.id"
		value="<%=Constant.ACTION_TYPE_D%>">
		<tr>
			<td width="30%" align="right" height="25">到银行：</td>
			<td width="70%" class="fontgraydrop14" height="25"><bean:write
				name="bankName0" />, <bean:write name="aqb" property="bankName" /></td>
		</tr>
		<tr>
			<td width="30%" align="right" height="25">账号：</td>
			<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
				property="cardNo" /></td>
		</tr>
	</logic:equal>
	<!-- 退款 -->
	<logic:equal name="aqb" property="actionType.id"
		value="<%=Constant.ACTION_TYPE_R%>">
		<tr>
			<td width="30%" align="right" height="25">到银行：</td>
			<td width="70%" class="fontgraydrop14" height="25"><bean:write
				name="bankName0" /> <logic:notEmpty name="aqb" property="cardNo">
		(<bean:write name="aqb" property="cardNo" />)
		</logic:notEmpty></td>
		</tr>
	</logic:equal>
	<!-- 转出至卡 -->
	<logic:equal name="aqb" property="actionType.id"
		value="<%=Constant.ACTION_TYPE_Y%>">
		<tr>
			<td width="30%" align="right" height="25">到卡：</td>
			<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
				property="cardNo" /></td>
		</tr>
	</logic:equal>
	<!-- 交易类型 -->
	<tr>
		<td width="30%" align="right" height="25">交易类型：</td>
		<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
			property="actionType.actionName" /></td>
	</tr>
	<tr>
		<td width="30%" align="right" height="25">金额：</td>
		<td width="70%" class="fontgraydrop14" height="25"><span
			id="debitSubAccountBalanceSpan" class="orangefont14b"><ad:FormatPrase>
			<bean:write name="aqb" property="amount" />
		</ad:FormatPrase></span> 元</td>
	</tr>
	<tr>
		<td width="30%" align="right" height="25">手续费：</td>
		<td width="70%" class="fontgraydrop14" height="25"><span
			id="debitSubAccountBalanceSpan" class="orangefont14b"><logic:present
			parameter="fee">
			<bean:parameter id="fee" name="fee" />
		</logic:present><ad:FormatPrase>
			<bean:write name="fee" />
		</ad:FormatPrase></span> 元</td>
	</tr>
	<tr>
		<td width="30%" align="right" height="25">交易状态：</td>
		<td width="70%" class="fontgraydrop14" height="25"><ad:write
			typeid="ES_PRE_PAY_TRANS_STATUS" name="aqb" property="transStatus" /></td>
	</tr>
	<logic:notEmpty name="aqb" property="tradeType">
		<tr>
			<td width="30%" align="right" height="25">交易模式：</td>
			<td width="70%" class="fontgraydrop14" height="25"><ad:write
				typeid="TRADE_TYPE" name="aqb" property="tradeType" /></td>
		</tr>
	</logic:notEmpty>
	<tr>
		<td width="30%" align="right" height="25">交易开始日期：</td>
		<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
			format="yyyy-MM-dd HH:mm:ss" property="beginDate" /></td>
	</tr>
	<logic:notEmpty name="aqb" property="endDate">
		<tr>
			<td width="30%" align="right" height="25">交易结束日期：</td>
			<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
				format="yyyy-MM-dd HH:mm:ss" property="endDate" /></td>
		</tr>
	</logic:notEmpty>
	<!-- 付款给对方银行 -->
	<logic:equal name="aqb" property="actionType.id"
		value="<%=Constant.ACTION_TYPE_G%>">
		<tr>
			<td width="30%" align="right" height="25">开户行省份：</td>
			<td width="70%" class="fontgraydrop14"><ad:write
				typeid="CITY_INFO" name="aqb" property="bankProvSeq" /></td>
		</tr>
		<tr>
			<td width="30%" align="right" height="25">开户行城市：</td>
			<td width="70%" class="fontgraydrop14"><ad:write
				typeid="CITY_INFO" name="aqb" property="bankCitySeq" /></td>
		</tr>
		<tr>
			<td width="30%" align="right" height="25">收款方姓名：</td>
			<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
				property="personName" /></td>
		</tr>
		<tr>
			<td width="30%" align="right" height="25">收款方email：</td>
			<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
				property="personMail" /></td>
		</tr>
		<tr>
			<td width="30%" align="right" height="25">收款方电话：</td>
			<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
				property="personPhone" /></td>
		</tr>
		<tr>
			<td width="30%" align="right" height="25">收款方手机：</td>
			<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
				property="personMobile" /></td>
		</tr>
	</logic:equal>
	<logic:notEqual name="aqb" property="actionType.id"
		value="<%=Constant.ACTION_TYPE_D%>">
		<logic:notEqual name="aqb" property="actionType.id"
			value="<%=Constant.ACTION_TYPE_G%>">
			<logic:empty name="aqb" property="batchNo">
				<tr>
					<td width="30%" align="right" height="25">商品信息：</td>
					<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
						property="commodityInfo" /></td>
				</tr>
			</logic:empty>
		</logic:notEqual>
	</logic:notEqual>
	<tr>
		<td width="30%" align="right" height="25">资金用途：</td>
		<td width="70%" class="fontgraydrop14" height="25"><bean:write name="aqb"
			property="purpose" /></td>
	</tr>
	<tr>
		<td width="30%" align="right" height="25">备注：</td>
		<td width="70%" class="fontgraydrop14"><bean:write name="aqb"
			property="remark" /></td>
	</tr>
	<logic:equal name="type" value="1">
		<logic:equal name="aqb" property="transStatus" value="1">
			<tr>
				<td width="30%" align="right" height="25">处理意见：</td>
				<td width="70%" class="fontgraydrop14" height="25">
					<input class="inputStyle" size="20" type="text" name="attitude" id="attitude"/>
				(当您审核拒绝该笔交易时，请务必填写您的理由)</td>
			</tr>
			<logic:present name="b2c_notavaiable">
				<tr>
					<td width="30%" align="right" colspan="2"><font
						color="#FF0000"><bean:write name="b2c_notavaiable" /></font></td>
				</tr>
			</logic:present>
		</logic:equal>
	</logic:equal>
	<input type="hidden" name="audit" value="Y" id="audit"/>
	<input type="hidden" name="transactionID" id="transactionID" value="<bean:write name="aqb" property="id"/>" />
	<logic:equal name="aqb" property="transStatus" value="2">
		<logic:equal name="type" value="1">
			<tr>
				<td width="30%" align="right" height="25">支付密码：<span class="orang12b">*</span></td>
				<td width="70%" class="fontgraydrop14" height="25"><input
					class="inputStyle" size="20" type="password" name="pinkUpPass" /></td>
			</tr>
			<logic:present name="b2c_notavaiable">
				<tr>
					<td width="30%" align="right"><font color="#FF0000"><bean:write
						name="b2c_notavaiable" /></font></td>
				</tr>
			</logic:present>
		</logic:equal>
	</logic:equal>
	<logic:notEmpty name="history">
		<tr>
			<td colspan="2" bgcolor="#FFFFFF">
			<table width="100%" class="tablestyle">
				<tr height="36">
					<th><span class="blue14">审核人</span></th>
					<th><span class="blue14">审核时间</span></th>
					<th><span class="blue14">处理动作</span></th>
					<th><span class="blue14">处理意见</span></th>
				</tr>
				<c:forEach var="id" items="${history}" varStatus="status">
					<c:if test="${status.index % 2 == 0}">
						<tr height="28" align="center" class="tableWhiteBg">
					</c:if>
					<c:if test="${status.index % 2 == 1}">
						<tr height="28" align="center" class="tableBlueBg">
					</c:if>
					<td><bean:write name="id" property="updateUserName" /></td>
					<td><bean:write name="id" property="auditOperation.updateTime"
						format="yyyy-MM-dd HH:mm:ss" /></td>
					<td><logic:equal name="id" property="created" value="true">创建</logic:equal>
					<logic:equal name="id" property="submitted" value="true">提交</logic:equal>
					<logic:equal name="id" property="aggreed" value="true">同意</logic:equal>
					<logic:equal name="id" property="rejected" value="true">拒绝</logic:equal>
					</td>
					<td><bean:write name="id" property="auditOperation.attitude" /></td>
					</tr>
				</c:forEach>
			</table>
			</td>
		</tr>
	</logic:notEmpty>
</table>
<table width="100%" height="55" border="0" cellpadding="0"
	cellspacing="0">
	<tr>
		<td width="30%" align="center"><logic:equal name="type" value="1">
			<logic:equal name="aqb" property="transStatus" value="1">
				<input type="button" value="同意" class="button_style"
					onclick="auditIt('Y');"
					<logic:present name="b2c_notavaiable">disabled</logic:present> />
				<input type="button" value="拒绝" class="button_style"
					onclick="auditIt('N');" />
			</logic:equal>
			<logic:equal name="aqb" property="transStatus" value="2">
				<logic:equal name="aqb" property="actionType.id"
					value="<%=Constant.ACTION_TYPE_R%>">
					<!-- 退款 -->
					<input type="submit" value="退款" class="button_style"
						<logic:present name="b2c_notavaiable">disabled</logic:present> />
				</logic:equal>
				<logic:notEqual name="aqb" property="actionType.id"
					value="<%=Constant.ACTION_TYPE_R%>">
					<input type="submit" value="支付" class="button_style"
						<logic:present name="b2c_notavaiable">disabled</logic:present> />
				</logic:notEqual>
				<input type="button" value="取消" class="button_style"
					onclick="cancelTransaction();" />
			</logic:equal>
		</logic:equal> <input type="button" value="返 回" class="button_style"
			onclick="history.back()" /> &nbsp;&nbsp;&nbsp;&nbsp;</td>
	</tr>
</table>
</form>
</div>
</div>
</div>
</div>
